#include "bsp_AiNet.h"
#include "stm32f4xx_hal.h"     
#include "app_x-cube-ai.h"
         

ai_buffer* Get_Inputs(void)
{
	ai_u16 *in_buffer=(short unsigned int*)0;
	return ai_network_inputs_get(network,in_buffer);
}
ai_buffer* Get_Outputs(void)
{
	ai_u16 *out_buffer=(short unsigned int*)0;
	return ai_network_outputs_get(network,out_buffer);
}
void PrepareInput(ai_float* InputData)
{
	ai_input=Get_Inputs();
	ai_input->data=InputData;
}
ai_i32* Predict()
{
	ai_output=Get_Outputs();
	ai_run();
	return (ai_i32*)ai_output->data;
}
void NetPrint()
{
	printf("Input shape:");
	for(int i=0;i<Get_Inputs()->shape.size;i++)
	{
		printf("%d ",Get_Inputs()->shape.data[i]);
	}
	printf("\r\n");
	printf("Output shape:");
	for(int i=0;i<Get_Outputs()->shape.size;i++)
	{
		printf("%d ",Get_Outputs()->shape.data[i]);
	}
	printf("\r\n");
}



